﻿
using System.Diagnostics;


namespace CrazyMan.TM.Interface.Domain
{
    /// <summary>
    /// Represents a break in betting.
    /// </summary>
    [DebuggerDisplay("Duration {Duration}; Title {Title}")]
    public class BreakInterval : Interval
    {
        private string _title;

        /// <summary>
        /// Creates a new break interval.
        /// </summary>
        public BreakInterval()
            : base()
        {
            _title = "";
        }

        /// <summary>
        /// Creates a new break of a specified duration.
        /// </summary>
        /// <param name="duration">The duration of the break.</param>
        public BreakInterval(int duration)
            : base(duration)
        {
            _title = "";
        }

        /// <summary>
        /// Creates a new break of a specified duration and with a title.
        /// </summary>
        /// <param name="duration">The duration of the break.</param>
        /// <param name="title">The title of the break.</param>
        public BreakInterval(int duration, string title)
            : base(duration)
        {
            _title = title;
        }

        /// <summary>
        /// Gets and sets the title of the break.
        /// </summary>
        public string Title
        {
            get { return _title; }
            set
            {
                if (value == null)
                    value = string.Empty;

                _title = value;
            }
        }
    }
}
